package com.study.d4_coll_nature;

import java.util.Collection;
import java.util.LinkedList;

public class LinkedListDemo {
    public static void main(String[] args) {
        //LinkedList基于双链表实现
        LinkedList<String> list = new LinkedList<>();
        list.addLast("java");
        list.addLast("haha");
        list.addLast("hehe");
        System.out.println(list);
        System.out.println(list.removeFirst());
        System.out.println(list);
        list.addFirst("c");//list.push()
      //  list.removeFirst(); list.pop()
        System.out.println(list);
    }
}
